package com.wangyuhang.service.impl;

import com.wangyuhang.dao.userDao;
import com.wangyuhang.domain.User;
import com.wangyuhang.service.userService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class userServiceImpl implements userService {
    @Autowired
    private userDao dao;

    @Override
    public User findById(Integer id) {
        return dao.findById(id);
    }

    @Override
    public List<User> findAll() {
        return dao.findAll();
    }

    @Override
    public boolean deleteById(Integer id) {
        boolean flag=false;
        if (dao.deleteById(id)){
            flag=true;
        }
        return flag;
    }

    @Override
    public void save(User user) {
        dao.save(user);
    }

    @Override
    public void update(User user) {
        dao.update(user);
    }

}
